<template>
  <ul>
    <li v-for="item in goodslist" :key="item.id" @click="goListDetail(item.id)">
      <img v-lazy="item.list_pic_url" alt="" width="100%" />
      <div class="van-ellipsis">
        {{ item.name }}
      </div>
      <div class="price">{{ "¥" + item.retail_price }}</div>
    </li>
  </ul>
</template>

<script>
export default {
  props: ["goodslist"],
  mounted() {},
  data() {
    return {
      imgSrc: require("@/assets/logo.png"),
    };
  },
  methods: {
    goListDetail(value) {
      // console.log("执行了跳转");
      this.$router.push("/listDetail?id=" + value);
    },
  },
};
</script>
 
<style lang = "less" scoped>
ul {
  padding: 0.1rem 1%;
  display: flex;
  flex-wrap: wrap;
  background-color: #fff;
  font-size: 0.186667rem;
  li {
    width: 49%;
    padding-left: 0.1rem;
    padding-right: 0.1rem;
    box-sizing: border-box;
    text-align: center;
    .price {
      line-height: 0.3rem;
      color: darkred;
    }
  }
}
</style>